package com.springboot.mail.modules.User.domain.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;

/**
 *
 * @Description
 * @Author LY L
 * @Date 2024-11-05
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Validated     // springboot 2.5.* 版本需要在类上标注 @Validated 注解校验注解才会生效。
public class UpdatePasswordVO {

    @Length(min = 6,max = 18,message = "旧密码 长度在 6 到 18 个字符")
    @NotBlank(message = "请输入旧密码")
    @ApiModelProperty(value = "旧密码", required = true)
    String oldPassword;

    @Length(min = 6,max = 18,message = "新密码 长度在 6 到 18 个字符")
    @NotBlank(message = "请输入新密码")
    @ApiModelProperty(value = "新密码", required = true)
    String newPassword;
}
